//
import { createStore } from 'vuex'

export default createStore({
  state: {
    isLogin: localStorage.getItem('token')??false,
    search: '',
    products: [],
    categories: []
  },
  getters: {
    getLoginStatus: state => state.isLogin,
    getproduct: state => state.products,
  },
  mutations: {
    setLoginStatus(state, status) {
      state.isLogin = status
    },
    setproduct(state, products) {
      state.products = products
    },
  },
  actions: {
  },
  modules: {
  }
})
